<script>
	export default {
		globalData: {
			system: [], //系统配置
			userInfo: {}, //用户信息.
		},
		onLaunch: function() {
			let userInfo = uni.getStorageSync('userInfo')
			let token = uni.getStorageSync('token')
			if (userInfo && userInfo.id && token) {
				console.log('已登录')
				this.globalData.userInfo = userInfo
					uni.setStorageSync('userInfo', res.data)
					uni.setStorageSync('token', res.data.token)
					this.globalData.userInfo = res.data
			} else {
				console.log('没登陆')
				this.$api.silentLogin('weixin').then(res => {
				})
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import '@/styles/style_scss.scss';
	// 设置整个项目的背景色
	page {
		background-color: #f5f5f5;
	}
</style>
